""" 3_1 模拟输入：光线传感器 """
# https://learn.adafruit.com/adafruit-esp32-s3-tft-feather/analog-in

import time
import board
import analogio

analog_pin = analogio.AnalogIn(board.A1)

while True:
    print(analog_pin.value)
    brightness = 100 - (analog_pin.value/65535 * 100)
    print("brightness is %d" % brightness)
    time.sleep(0.1)
